//
//  HistogramCell.swift
//  Xiaozihui
//
//  Created by 校企荟 on 2017/10/10.
//  Copyright © 2017年 校企荟. All rights reserved.
//

import UIKit

class HistogramCell: BaseTableViewCell {

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    override func setupUI() {
//        JHColumnChart(frame: CGRect.zero)
        
        let view = UIView()
        contentView.addSubview(view);
        view.backgroundColor = UIColor.gray
        view.snp.makeConstraints { (make) in
            make.height.equalTo(160 * ScaleX)
            make.edges.equalTo(contentView)
        }
        
        let column = JHColumnChart(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 160 * ScaleX))
//
        column.valueArr = [[NSNumber(value: 12)],[NSNumber(value: 12)],[NSNumber(value: 12)],[NSNumber(value: 12)]]
        column.columnBGcolorsArr = [[UIColor.white],[UIColor.white],[UIColor.white],[UIColor.white],[UIColor.white],[UIColor.white]]
        column.dashColor = UIColor.white
        column.lineChartPathColor = UIColor.white
        column.originSize = CGPoint(x: 30, y: 20)
        column.backgroundColor = mainColor
        column.drawTextColorForX_Y = UIColor.white
        column.colorForXYLine = UIColor.white
        column.typeSpace = 30
        
        column.isShowYLine = true
        column.contentInsets = UIEdgeInsets(top: 5, left: 0, bottom: 0, right: 0)
        column.columnWidth = (ScreenWidth - 50) / 6
        
        column.showAnimation()
        view.addSubview(column)
//        column.showAnimation()
//        column.valueArr = @[
//        @[@[@15,@10]],//第一组元素 如果有多个元素，往该组添加，每一组只有一个元素，表示是单列柱状图| | | | |
//        @[@[@15,@20]],//第二组元素
//        @[@[@10,@5]],//第三组元素
//        @[@[@21,@12]],
//        @[@19],
//        @[@12],
//        @[@15],
//        @[@9],
//        @[@8],
//        @[@6],
//        @[@9],
//        @[@18],
//        @[@11],
//        ];
//        /*       This point represents the distance from the lower left corner of the origin.         */
//        column.originSize = CGPointMake(30, 20);
//        /*    The first column of the distance from the starting point     */
//        column.drawFromOriginX = 20;
//        column.backgroundColor = [UIColor yellowColor];
//        column.typeSpace = 10;
//        column.isShowYLine = NO;
//        column.contentInsets = UIEdgeInsetsMake(5, 0, 0, 0);
//        /*        Column width         */
//        column.columnWidth = 30;
//        /*        Column backgroundColor         */
//        column.bgVewBackgoundColor = [UIColor yellowColor];
//        /*        X, Y axis font color         */
//        column.drawTextColorForX_Y = [UIColor blackColor];
//        /*        X, Y axis line color         */
//        column.colorForXYLine = [UIColor darkGrayColor];
//        /*    Each module of the color array, such as the A class of the language performance of the color is red, the color of the math achievement is green     */
//        column.columnBGcolorsArr = @[@[[UIColor redColor],[UIColor greenColor]],@[[UIColor redColor],[UIColor greenColor]],@[[UIColor redColor],[UIColor greenColor]]];//如果为复合型柱状图 即每个柱状图分段 需要传入如上颜色数组 达到同时指定复合型柱状图分段颜色的效果
//        /*        Module prompt         */
//        column.xShowInfoText = @[@"A班级",@"B班级",@"C班级",@"D班级",@"E班级",@"F班级",@"G班级",@"H班级",@"i班级",@"J班级",@"L班级",@"M班级",@"N班级"];
//        column.isShowLineChart = YES;
//        column.lineValueArray =  @[
//        @6,
//        @12,
//        @10,
//        @1,
//        @9,
//        @5,
//        @9,
//        @9,
//        @5,
//        @6,
//        @4,
//        @8,
//        @11
//        ];
//
//        column.delegate = self;
//        /*       Start animation        */
//        [column showAnimation];
//        [self.view addSubview:column];
    }
}
